package com.zixun.activity;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.zixun.R;


/**
 * 作者：郭郭
 * 设置窗口
 */

public class SettingActivity extends Activity {


    private TextView version_text;
    private Button btn_logout;//退出登录
    private TextView center_text;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);

        initView();
        initData();
    }

    private void initView() {

        center_text = (TextView) findViewById(R.id.center_text);
        btn_logout = (Button) findViewById(R.id.btn_logout);

        version_text = (TextView) findViewById(R.id.version_text);

        try {
            PackageManager manager = this.getPackageManager();
            PackageInfo info = manager.getPackageInfo(this.getPackageName(), 0);
            version_text.setText("V" + info.versionName);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private void initData() {
        center_text.setText("设置");
        btn_logout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

}
